/**
 * Created by luojie on 2018/3/14.
 */

import "../css/activity-detail.scss";
import api from "../utils/api";

const bg1 = require("../images/instro-bg1.png");
const bg2 = require("../images/instro-bg2.png");

const img1 = require("../images/detail-bg1.png");
const img2 = require("../images/detail-bg2.png");
const img3 = require("../images/detail-bg3.png");
const img4 = require("../images/detail-bg4.png");
const img5 = require("../images/detail-bg5.png");
const img6 = require("../images/detail-bg6.png");
const img7 = require("../images/detail-bg7.png");
const img8 = require("../images/detail-bg8.png");
const img9 = require("../images/detail-bg9.png");
const img10 = require("../images/detail-bg10.png");
const img11= require("../images/detail-bg11.png");
const img12= require("../images/detail-bg12.png");
const img13 = require("../images/detail-bg13.png");
const img14 = require("../images/detail-bg14.png");
const img15 = require("../images/detail-bg15.png");
const img16 = require("../images/detail-bg16.png");
const img17 = require("../images/detail-bg17.png");

export default class Detail extends React.PureComponent{
	constructor(props){
		super(props);
		this.goBuy = this.goBuy.bind(this);
	}
	componentDidMount(){

	}
	goBuy(){
		let openid = getCookie("openid");
		ajax(api.getIsLogin,{openid},"post").then((result)=>{
			if(result.status === 1){
				if(result.datas){
					this.props.history.push("/myMember");
				}else{
					this.props.history.push("/login");
				}
			}else {
				showMsg(result.message);
			}
		})
	}
	render(){
		return(
			<div className="activity-detail">
				<div className="activity-detail-container">
					<img className="activity-detail-bg1" src={bg1} alt=""/>
					<img className="activity-detail-bg2" src={bg2} alt=""/>
					<div className="activity-detail-content">
						<div className="activity-detail-content-bg">


							<img className="w-100 activity-detail-img1" src={img1} alt=""/>
							<img className="w-100 activity-detail-img2" src={img2} alt=""/>
							<img className="w-100 activity-detail-img3" src={img3} alt=""/>
							<img className="w-100 activity-detail-img3" src={img4} alt=""/>
							<img className="w-100 activity-detail-img3" src={img5} alt=""/>
							<img className="w-100 activity-detail-img3" src={img6} alt=""/>
							<img className="w-100 activity-detail-img3" src={img7} alt=""/>
							<img className="w-100 activity-detail-img3" src={img8} alt=""/>
							<img className="w-100 activity-detail-img3" src={img9} alt=""/>
							<img className="w-100 activity-detail-img3" src={img10} alt=""/>
							<img className="w-100 activity-detail-img3" src={img17} alt=""/>
							<img className="w-100 activity-detail-img3" src={img11} alt=""/>
							<img className="w-100 activity-detail-img2" src={img12} alt=""/>
							<img className="w-100 activity-detail-img3" src={img13} alt=""/>
							<img className="w-100 activity-detail-img3" src={img14} alt=""/>
							<img className="w-100 activity-detail-img3" src={img15} alt=""/>
							<img className="w-100 activity-detail-img4" src={img16} alt=""/>
						</div>
					</div>
					<div className="activity-detail-buy-row">
						<div className="bottom-btn-mask">
							<button onClick = {this.goBuy} className="activity-detail-buy-btn">
								点击参与抢购
							</button>
						</div>
					</div>
				</div>
			</div>
		)
	}
}